<?php
namespace app\admin\logic\admin;

use app\common\logic\AdminBase;
use app\common\model\AdminGroupModel;
use app\common\model\AdminModel;
use think\facade\Db;
use think\facade\Event;
use think\facade\Log;
use think\facade\Session;

class Admin extends AdminBase
{
    public function __construct()
    {
        $this->model = new AdminModel();
    }

    public function getList($params)
    {
        $this->model->alias('a')
                    ->field('a.*,g.name as group_name')
                    ->join('admin_group g', 'g.id = a.group_id')
                    ->order('a.id');

        return parent::getList($params);
    }

    public function get($params)
    {
        $result['groups'] = AdminGroupModel::selectArray();
        $result['one'] = parent::get($params);

        return $result;
    }
}